export default {
	methods: {
		loginOut(targetUrl,cb) {
			uni.showModal({
				title: "温馨提醒",
				content: "确认退出当前帐号？",
				success: (res) => {
					if (res.confirm) {
						cb && cb();
						uni.removeStorageSync("person-id");
						uni.removeStorageSync("company-id");
						uni.removeStorageSync("login-status");
						uni.removeStorageSync("recCardInfo");
						uni.removeStorageSync("fromLoginStatus");
						getApp().globalData.userInfo = {};
						getApp().globalData.companyInfo = {};
						getApp().globalData.msgUnreadCnt = "";
						getApp().globalData.loginStatus = "";
						getApp().globalData.conversationList = [];
						getApp().globalData.messageList = [];
						getApp().globalData.tabBarList = getApp().globalData.personTabs;
						getApp().globalData.tim && getApp().globalData.tim.logout();
						setTimeout(() => {
							getApp().globalData.tim = null;
							uni.reLaunch({
								url: targetUrl || "/pages/index/index",
							});
						}, 0);
					}
				},
			});
		}
	}
}